package com.atguigu.tingshu.album.clien;

import com.atguigu.tingshu.album.service.TrackInfoService;
import com.atguigu.tingshu.model.album.TrackInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/***
 * 声音微服务提供的内部调用层
 * 提供给feign使用
 */
@RestController
@RequestMapping("/client/track/TrackInfo")
public class TrackClientController {
    @Autowired
    private TrackInfoService trackInfoService;

    @GetMapping("getTrackInfo/{trackId}")
    public TrackInfo getTrackInfo(@PathVariable(value = "trackId")Long trackId) {
        return trackInfoService.getById(trackId);
    }

    /**
     * 获取声音详情
     * @param itemId
     * @return
     */
    @GetMapping("/getTrackInfoDetail/{itemId}")
    public TrackInfo getTrackInfoDetail(@PathVariable(value = "itemId") Long itemId){
        return trackInfoService.getById(itemId);
    }
}
